local dongliu = fk.CreateSkill {
  name = "lingling__dongliu",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["lingling__dongliu"] = "东流",
  [":lingling__dongliu"] = "锁定技，游戏开始时，将牌堆所有的【五谷丰登】改为【顺手牵羊】。",
}

dongliu:addEffect(fk.GamePrepared, {
  can_trigger = function (self, event, target, player, data)
    return player:hasSkill(dongliu.name)
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    for i = #room.draw_pile, 1, -1 do
      local card = Fk:getCardById(room.draw_pile[i])
      if card.trueName == "amazing_grace" then
        local new_id = room:printCard("ling__snatch", card.suit, card.number).id
        room.draw_pile[i] = new_id
        room:setCardArea(card.id, Card.Void, nil)
        room:setCardArea(new_id, Card.DrawPile, nil)
      end
    end
    room:syncDrawPile()
  end,
})

return dongliu
